<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  template="/WEB-INF/layouts/templateAdmin.xhtml">


  <ui:define name="menu">
    <!-- INCLUDE MENU -->
  </ui:define>

  <ui:define name="content">

    <c:if test="${flowScope.val == true}">
      <c:set var="title" scope="view" value="More informations" />
    </c:if>
    <c:if test="${flowScope.val == false}">
      <c:set var="title" scope="view" value="Modify section" />
    </c:if>

    <!-- INCLUDE CONTENT -->
    <h1 class="pageTitle">#{title}</h1>

    <h:form id="showSection">
      <h:panelGrid columns="2">
        <h:outputText class="inlineText" value="Name* : " />
        <h:panelGroup>
          <h:inputText value="#{flowScope.sectionSelected.name}"
            id="name" required="true" disabled="#{val}" />
          <h:message for="name" />
        </h:panelGroup>

        <h:outputText value="Mother Section :" />
        <h:panelGroup>
          <h:selectOneMenu
            value="#{flowScope.sectionSelected.motherCategory}"
            id="motherCategory" disabled="#{val}">
            <f:selectItem itemValue="-1" itemLabel="--" />
            <c:forEach items="${flowScope.motherSections}" var="e">
              <f:selectItem itemValue="#{e.id}" itemLabel="#{e.name}" />
            </c:forEach>

          </h:selectOneMenu>
          <h:message for="motherCategory" />
        </h:panelGroup>
      </h:panelGrid>

      <br />

      <h:commandButton value="Modify Section" action="modify"
        type="submit" />

      <c:if test="${flowScope.val == true}">
        <h:commandButton value="Delete Section" action="delete"
          type="submit" />
      </c:if>
    </h:form>

    <br />

    <h:form>
      <h:commandLink action="back">
        Back
      </h:commandLink>
    </h:form>
  </ui:define>
</ui:composition>
